import request from "@/utils/request";

// 获取咨询师列表
export const consultantList = async () => {
    try {
        const res = await request.get("/api/consultant/list.do");
        return res.data;
    } catch (error) {
        console.error("获取咨询师列表失败:", error);
        throw error;
    }
};

// 添加咨询师
export const insertConsultant = async (obj) => {
    try {
        const res = await request.post("/api/consultant/insert.do", obj);
        return res;
    } catch (error) {
        console.error("添加咨询师失败:", error);
        throw error;
    }
};

// 删除咨询师
export const deleteConsultant = async (obj) => {
    try {
        const res = await request.post("/api/consultant/deleteById.do", obj);
        return res;
    } catch (error) {
        console.error("删除咨询师失败:", error);
        throw error;
    }
};

// 更新咨询师
export const updateConsultant = async (obj) => {
    try {
        const res = await request.post("/api/consultant/update.do", obj);
        return res;
    } catch (error) {
        console.error("更新咨询师失败:", error);
        throw error;
    }
};